import './App.css';
import { Redirect, Route } from "react-router-dom"
import { routes } from "./router";
import WithLazy from "./utils/withLazy";

function App() {
  return (
    <div className="App">
      <Redirect exact={true} from="/" to="/Home" ></Redirect>
      {
        routes.map(item=><Route key={item.path} path={item.path} component={WithLazy(()=>import(`./views/${item.component}`))}></Route>)
      }
    </div>
  );
}

export default App;
